#ifndef SHADEREFFECT_H
#define SHADEREFFECT_H

#include <d3dx9.h>
#include <string>
#include <conio.h>

#include "Texture.h"

class ShaderEffect
{
	private:
									/// Keep track of effect in use
		bool inEffect;
									/// Used to compare in coming textures
		Texture * mTexture;
									///Effect
		LPD3DXEFFECT effect;
									///Buffer For Error Messages
		LPD3DXBUFFER compile_errors;
				
									///Matrix handle
		D3DXHANDLE Handle_gWVP;
									///Technique handle
		D3DXHANDLE Handle_tech;
									///Texture handle
		D3DXHANDLE Handle_tex;

	public:
							///Constructor
		ShaderEffect();
							///Destructor
		~ShaderEffect();

													///Load Effect File
		void LoadEffect(LPDIRECT3DDEVICE9 d3ddev);

													///Set Effect Technique
		void SetEffectTech(std::string param);
													///Set Effect Parameter ( Texture )
		void SetEffectTex(std::string param, Texture * texture);
													///Set Effect Parameter ( Matrix )
		void setTestParam(D3DXMATRIX M, std::string param);
													///Use Loaded Effect
		void UseEffect(int pass = 0);
													////Stop Using Effect
		void StopEffect();


std::string currentTechnique;
};

#endif